<?php
$title = $_POST['title'];
$director = $_POST['director'];
$released = $_POST['released'];
$filmed_in = $_POST['filmed_in'];
$bad_movie = $_POST['bad_movie'];
$genre = $_POST['genre'];
$description = $_POST['description'];

$conn = mysql_connect('localhost','root','');
if(!$conn){
    die('Could not connect..');
}

mysql_select_db('dbtraining',$conn);


$sql = "insert into movie(xtitle,director,released,filmed_id,bad_movie,genre,description) 
values('$title','$director','$released','$filmed_in','$bad_movie',$genre,'$description')";
mysql_query($sql) or die('{success:false,errors:{title:"'.mysql_error().'"}}');

mysql_close($conn);


?>
